package com.ck.ckcloud.networkmanagement.infrastructure.repository;

import com.ck.ckcloud.networkmanagement.domain.ResourceFactory;
import com.ck.ckcloud.networkmanagement.domain.aggregate.NetworkManagement;
import com.ck.ckcloud.networkmanagement.domain.entity.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

/**
 * 网管仓储
 *
 * @author Aiden <a href="mailto:adam602260@gmail.com"/>
 * @version NetworkManagementRepository.java v0.1
 * @create 2019-09-18 20:03
 */
@Repository
public class NetworkManagementRepository {

	/**
	 * 资源工厂类
	 */
	@Autowired
	private ResourceFactory resourceFactory;

	public NetworkManagement getNetworkManagementByResourceUniqueId(String uniqueId){
		Resource resource = resourceFactory.createResource();
		NetworkManagement networkManagement  = new NetworkManagement(resource.getByUniqueId(uniqueId));
		return networkManagement;
	}

}
